package com.atwisdom.star.serviceController;

import com.alibaba.fastjson.JSON;
import com.atwisdom.star.thirdInterface.pojo.AecpGatewayResult;
import com.atwisdom.star.thirdInterface.util.AecpGatewayRequestUtil;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

@RestController
@RequestMapping("/yida")
public class YIDAController {

    /**
     * 请求接口地址
     */
    public static final String SEARCH_FORM_DATAS = "/yida_vpc/form/searchFormDatas.json";
    public static final String GET_USER_LIST = "/yida_vpc/corp/getAliyunAuthInfo.json";


    @GetMapping("/hello")
    public String hello() {

        AecpGatewayResult result = null;
        try {
            Map<String, String> param = new HashMap<String, String>();
//            param.put("pageSize", "10");
//            param.put("currentPage", "1");
//            param.put("appType", "APP_R0NJ5FXWWJY9P2SOJE6M");
//            param.put("systemToken", "");
//            param.put("userId", "124568121629463772");
//            param.put("formUuid", "FORM-2ABC22F7DCE24FAA91E788A126634FF1NXBF");
            param.put("pageSize", "10");
            param.put("currentPage", "1");
            param.put("AccountName", "王红艳");

            result = AecpGatewayRequestUtil.baseRequest(param, GET_USER_LIST);

            System.out.println(result);

            return JSON.toJSONString(result);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return "error";
    }
}
